package cn.sofwin.day0115.homework;

import java.util.Scanner;

public class ArrayTest {
    public static void main(String[] args) {
        double[] price = new double[5];
        double sum = 0.0;
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 5; i++){
            System.out.print("请输入第" + (i+1) + "笔购物金额：");
            price[i] = sc.nextDouble();
            sum = sum + price[i];
        }
        System.out.println("序号\t\t金额（元）");
        for (int i = 0; i < 5; i++){
            System.out.println((i+1) + "\t\t" + price[i]);
        }
        System.out.println("总金额\t" + sum);
    }
}
